<template>
  <div>
     city
     <button v-for="item of hots" :key="item" @click="handleCity(item)">{{item}}</button>
  </div>
</template>

<script>
export default {
  data(){
    return {
      hots:["武汉","长沙","广州"]
    }
  },
  methods:{
    handleCity(city){
      console.log(city)
      localStorage.setItem("city",city)
      this.$router.back()
    }
  }
}
</script>

<style>

</style>